package org.lanqiao.tjut.model;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.dbutils.handlers.BeanListHandler;
import org.lanqiao.tjut.bean.TBAdminBean;
import org.lanqiao.tjut.db.DBFactory;

public class UserLoginModel {
	/**
	 * 登录验证信息查询
	 * 
	 * @param adminB
	 *            登录信息
	 * @return 返回查询结果集
	 */
	public List<TBAdminBean> getUserLoginInfo(TBAdminBean adminB){
		//组织数据查询操作sql语句
		String strSql="select * from tbadmin where admin_name=? and admin_psw=?";
		//查询语句的sql参数
		List<Object> lstParas=new ArrayList<>();
		//添加参数
		lstParas.add(adminB.getAdmin_name());
		lstParas.add(adminB.getAdmin_psw());
		//调用db层执行sql语句
		List<TBAdminBean> lstAdmin=DBFactory.getDBDriverInstance().query(strSql,
				new BeanListHandler<>(TBAdminBean.class),lstParas.toArray());
		//返回登录查询结果集
		return lstAdmin;
	}
}
